/*    
 * Copyright (c) 2013 ISoftStone, Inc.
 * All right reserved.
 *
 * 文件名：      ChargingItemDetailServiceImpl.java
 * 作者:     Jacky Wang
 * 创建日期： 2013-7-25 下午03:37:18
 * 版本：           
 *
 */
package com.isoftstone.industry.aaa.core.service.assist.impl;

import java.sql.Timestamp;
import java.util.Date;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.isoftstone.industry.persistance.bean.ChargingItemDetail;
import com.isoftstone.industry.aaa.core.dao.assist.ChargingItemDetailDao;
import com.isoftstone.industry.aaa.core.service.assist.IChargingItemDetailService;
import com.isoftstone.modules.core.persistence.IGenericDao;
import com.isoftstone.modules.core.service.impl.GenericServiceImpl;
import com.isoftstone.modules.core.utils.DateUtils;

/**
 * @author jacky
 */
@Service
public class ChargingItemDetailServiceImpl extends GenericServiceImpl<ChargingItemDetail, String> implements IChargingItemDetailService
{
	@Resource
	private ChargingItemDetailDao	chargingItemDetailDao;

	@Override
	public IGenericDao<ChargingItemDetail, String> getDao()
	{
		return chargingItemDetailDao;
	}

	@Override
	public void markInvalid(String id)
	{
		chargingItemDetailDao.changeStatus(id, ChargingItemDetail.Status.INVALID, DateUtils.getCurrentTimestamp());
	}

	@Override
	public void changeLastChargingTimeAndChargingEndDate(String id, Timestamp modifiedTime, Date chargingEndDate)
	{
		chargingItemDetailDao.changeLastChargingTimeAndChargingEndDate(id, modifiedTime, chargingEndDate);
	}

	@Override
	public void changeLastChargingTime(String id, Timestamp modifiedTime) {
		chargingItemDetailDao.changeLastChargingTime(id, modifiedTime);
	}

}
